#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int n, m;
int x, y;
char type;

int theta0, theta1, theta2;
vector<pair<int, int>> v[2];

void judge()
{
    bool flag1 = false, flag2 = false;
    char sign = '\0';
    long long res = 0;
    res = theta0 + theta1 * v[0][0].first + theta2 * v[0][0].second; //取第一个计算其值大于还是小于一
    sign = res > 0 ? '+' : '-'; //判断其符号
    for (int i = 1; i < v[0].size(); i++)
    {
        long long temp = theta0 + theta1 * v[0][i].first + theta2 * v[0][i].second;
        if (temp * res > 0)
        {
            flag1 = true;
            continue;
        }
        else
        {
            flag1 = false;
            break;
        }
    }

    if (flag1)
    {
        res = theta0 + theta1 * v[1][0].first + theta2 * v[1][0].second;
        char temp = res > 0 ? '+' : '-';
        if (temp != sign)
        {

            for (int i = 1; i < v[1].size(); i++)
            {
                long long temp = theta0 + theta1 * v[1][i].first + theta2 * v[1][i].second;
                if (temp * res > 0)
                {
                    flag2 = true;
                    continue;
                }
                else
                {
                    flag2 = false;
                    break;
                }
            }
        }
    }

    if (flag1 && flag2)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

int main()
{
    cin >> n >> m;
    for (int i = 0; i < n; i++)
    {
        cin >> x >> y >> type;
        if (type == 'A')
        {
            v[0].push_back(make_pair(x, y));
        }
        else
        {
            v[1].push_back(make_pair(x, y));
        }
    }
    for (int i = 0; i < m; i++)
    {
        cin >> theta0 >> theta1 >> theta2;
        judge();
    }
   // system("pause");
}